#include <iostream>
#include <vector>
#include <string>

using namespace std;


class sta
{
public:
    int x,y;
    sta()
    {
    	x=0;
		y=0; 
	} 
    sta(int xx, int yy)
    {
        x=xx;
        y=yy;
    }
    ~sta(){}

    //赋值
    sta& operator=(const sta& t)
    {
        x=t.x;
        y=t.y;
        return *this;
    }

    //列表赋值
    sta& operator=(initializer_list<sta> li)
    {
        for(auto& e:li)
        {

        }
        return *this;
    }

    //合成赋值
    sta& operator+=(const sta& t)
    {
        x+=t.x;
        y+=t.y;
        return *this;
    }

    //前置++
    sta& operator++()
    {
        x++,y++;
        return *this;
    }

    //后置++
    sta operator++(int)
    {
        sta t=*this;
        x++,y++;
        return t;
    }

    //函数调用运算符
    void operator()()
    {
        cout<<"hello"<<endl;
    }

    void fun()
    {
        cout<<"Hello"<<endl;
    }

    //成员访问运算符
    sta& operator*()
    {
        return *this;
    }

    //成员访问运算符
    sta* operator->()
    {
        return & this->operator*();
    }
};

//输出运算符
ostream& operator<<(ostream& os, const sta &s)
{
    os<<"("<<s.x<<","<<s.y<<")";
    return os;
}

//输入运算符
istream& operator>>(istream& is, sta &s)
{
    is>>s.x>>s.y;
    return is;
}

//算数运算符
sta operator+(const sta& a, const sta& b)
{
    sta c;
    c.x=a.x+b.x;
    c.y=a.y+b.y;
    return c;
}

//关系运算符
bool operator==(const sta& a, const sta& b)
{
    if(a.x!=b.x) return false;
    if(a.y!=b.y) return false;
    return true;
}


int main()
{
    sta a,b(2,3);

    cin>>a;
    cout<<a<<endl;
    cout<<b<<endl;
    cout<<a+b<<endl;
    a+=b;
    cout<<a<<endl;

    cout<<a++<<endl;
    cout<<++a<<endl;
    cout<<a<<endl;
    
    a();

    vector<sta>v;
    v={a,b};

    sta* p=&a;
    p->fun();

    while(1);
    return 0;
}



